//
//  UILabel+Extension.swift
//  NSinaWeibo
//
//  Created by LoliQueen on 16/2/19.
//  Copyright © 2016年 LoliQueen. All rights reserved.
//

import UIKit

extension UILabel{

    class func factoryLabel(title:String,textSize:CGFloat,textColor:UIColor) -> UILabel {
        let l  = UILabel()
        l.text = title
        
        l.font = UIFont.systemFontOfSize(textSize)
        l.textColor = textColor
        l.sizeToFit()
        l.numberOfLines = 0
        l.textAlignment = .Center
        return l
    
    }
    ///扩展一个便利的构造方法
    convenience init(title:String,textSize:CGFloat,textColor:UIColor,aligmen:NSTextAlignment = .Center){
        //获取一个UILabel的对象
        self.init()
        
        self.text = title
        
        self.font = UIFont.systemFontOfSize(textSize)
        self.textColor = textColor
        self.sizeToFit()
        numberOfLines = 0
        textAlignment = aligmen
        
    }
}
